<template lang="pug">
.evidence-list-container
  el-row(:gutter='20')
    el-col(:span='6' v-for='item in list')
      el-card.box-card(
        :body-style="{ padding: '0px'}"
        style='min-height: 380px;'
        align='middle'
        )
          router-link.link-type(:to="'/cases/evidence?id='+ item.evidenceNo")
            img.image(src='https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png')
          div.detail
            div {{item.evidenceName}}
            .bottom.clearfix
              time.time {{ item.evidenceNo }}
              router-link.link-type(:to="'/cases/detail?id='")
              el-button.button(type='text') 操作按钮

</template>

<script>
import { fetchEvidenceList } from '@/api/cases'

export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        published: 'success',
        draft: 'info',
        deleted: 'danger'
      }
      return statusMap[status]
    }
  },
  props: {
    type: {
      type: String,
      default: 'DETAIL'
    }
  },
  data() {
    return {
      caseId: '',
      list: null,
      listQuery: {
        page: 1,
        pageSize: 5,
        caseId: ''
      },
      loading: false,
      currentDate: new Date()
    }
  },
  created() {
    console.log('e list created')
    this.caseId = this.$route.query.id

    this.getList()
  },
  methods: {
    getList() {
      this.loading = true
      this.listQuery.caseId = this.caseId
      fetchEvidenceList(this.listQuery).then(response => {
        this.list = response.data.list
        this.loading = false
      })
    },
    handleAdd() {
      this.resetTemp()
      this.dialogStatus = 'create'
      this.dialogFormVisible = true
      this.$nextTick(() => {
        this.$refs['dataForm'].clearValidate()
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.evidence-list-container {
  // position: relative;
  margin-top: 10px;
  max-width: 960;

  .el-card {
    min-width: 260px;
    margin-top: 20px;
    // transition: all .5s;

    .mid {
      margin-top: 25%;
      height: 50%;
    }
    .detail {
      padding: 14px;
      text-align: left;
    }
  }
  // .el-card:hover{
  //   margin-top: -5px;
  // }
  .time {
    font-size: 13px;
    color: #999;
  }

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both;
  }
}
</style>
